package com.zhuhao.basic.staticdemo;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.sql.SQLOutput;

/**
 * @Author zhuhao
 * @Date 2021/7/27 0027 10:02
 * @desc
 */
public class FinalDemo {

    public final static double t = Math.random();
    public static double i = Math.random();

    public static void main(String[] args) throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException, ClassNotFoundException {

        FinalDemo.i = 1D;
//        FinalDemo.t = 1D;

        System.out.println("static " + FinalDemo.i);
        System.out.println("final static" + FinalDemo.t);
        System.out.println();

        System.out.println("static " + FinalDemo.i);
        System.out.println("final static" + FinalDemo.t);
        System.out.println();

        System.out.println("static " + FinalDemo.i);
        System.out.println("final static" + FinalDemo.t);
        System.out.println();

        Class<?> aClass2 = Class.forName("com.zhuhao.basic.staticdemo.Initializationblock");
        System.out.println(aClass2.getName());

        Constructor<?>[] declaredConstructors = aClass2.getDeclaredConstructors();
        for (Constructor<?> constructor : declaredConstructors) {
            System.out.println(constructor);
        }
    }
}
